export default {
  state: {
    show_loading: false, //是否显示loading
    plus_ready: false,//plus 是否加载完成
    router_in_way: 'go',
    header_text: '',
    header_right_html: '',
    header_right_func: '',
    header_back_btn: false,

    show_search_view:false, //搜索界面

    // 名品商家信息
    mp_shop_info :'',

    show_collect_type:'goods',

    // 社区查询
    // 查询类型
    query_type:'',//train air_price air_time weather break
    shop_home_chanel_names:[],
    get_msg_text:'获取验证码',//获取验证码按钮显示文本
  },
  mutations: {
    loading(state, status) {
      // console.log("change_header_text-->"+kw)
      state.show_loading = status;
    },
    // 改变过场动画
    change_router_animate_way(state, way) {
      state.router_in_way = way;
    },
    change_header(state, info) {
      if (info.header_text) {
        state.header_text = info.header_text
      }
      state.header_right_html = info.header_right_html
      if (info.header_right_func) {
        state.header_right_func = info.header_right_func
      }
      state.header_back_btn = info.header_back_btn

    },
    // 初始化获取验证码的按钮文本
    get_msg_text_init(state, msg) {
      state.get_msg_text = msg
    },
   
    start_msg_interval(state) {
      console.log("start_msg_interval")
      let time = 60;
      let timer = setInterval(() => {
        if (time == 0) {
          state.get_msg_text = "获取验证码";
          clearInterval(timer)
          return;
        }
        
        state.get_msg_text = time+"";
        time--;

      },1000)
    },
    open_search_view(state,tf){
      state.show_search_view = tf;
    },
    updata_mp_shop_info(state,info){
      state.mp_shop_info = info;
    },
    updata_collect_type(state,type){
      state.show_collect_type = type;
    },
    updata_query_type(state,type){
      state.query_type = type
    },
    updata_shop_home_chanel_names(state,info){
      state.shop_home_chanel_names = info
    }
  }
}
